import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/drama_interact_info_entity.dart';

DramaInteractInfoEntity $DramaInteractInfoEntityFromJson(
    Map<String, dynamic> json) {
  final DramaInteractInfoEntity dramaInteractInfoEntity = DramaInteractInfoEntity();
  final int? praise = jsonConvert.convert<int>(json['praise']);
  if (praise != null) {
    dramaInteractInfoEntity.praise = praise;
  }
  final int? collect = jsonConvert.convert<int>(json['collect']);
  if (collect != null) {
    dramaInteractInfoEntity.collect = collect;
  }
  final int? share = jsonConvert.convert<int>(json['share']);
  if (share != null) {
    dramaInteractInfoEntity.share = share;
  }
  final bool? praiseBool = jsonConvert.convert<bool>(json['praise_bool']);
  if (praiseBool != null) {
    dramaInteractInfoEntity.praiseBool = praiseBool;
  }
  final bool? collectBool = jsonConvert.convert<bool>(json['collect_bool']);
  if (collectBool != null) {
    dramaInteractInfoEntity.collectBool = collectBool;
  }
  final bool? shareBool = jsonConvert.convert<bool>(json['share_bool']);
  if (shareBool != null) {
    dramaInteractInfoEntity.shareBool = shareBool;
  }
  return dramaInteractInfoEntity;
}

Map<String, dynamic> $DramaInteractInfoEntityToJson(
    DramaInteractInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['praise'] = entity.praise;
  data['collect'] = entity.collect;
  data['share'] = entity.share;
  data['praise_bool'] = entity.praiseBool;
  data['collect_bool'] = entity.collectBool;
  data['share_bool'] = entity.shareBool;
  return data;
}

extension DramaInteractInfoEntityExtension on DramaInteractInfoEntity {
  DramaInteractInfoEntity copyWith({
    int? praise,
    int? collect,
    int? share,
    bool? praiseBool,
    bool? collectBool,
    bool? shareBool,
  }) {
    return DramaInteractInfoEntity()
      ..praise = praise ?? this.praise
      ..collect = collect ?? this.collect
      ..share = share ?? this.share
      ..praiseBool = praiseBool ?? this.praiseBool
      ..collectBool = collectBool ?? this.collectBool
      ..shareBool = shareBool ?? this.shareBool;
  }
}